package com.gitee.wsl.common.ui.theme.local

import androidx.compose.ui.graphics.Color
import com.gitee.wsl.common.ui.theme.ComposeColorPaletteScheme


data class Material3ColorPalette(
    val `0`: Long,
    val `10`: Long,
    val `20`: Long,
    val `30`: Long,
    val `40`: Long,
    val `50`: Long,
    val `60`: Long,
    val `70`: Long,
    val `80`: Long,
    val `90`: Long,
    val `95`: Long,
    val `100`: Long
){
    companion object
}

operator fun Material3ColorPalette.get(shade: Int): Color {
    val colorLong = when (shade) {
        0-> this.`0`
        10 -> this.`10`
        20 -> this.`20`
        30 -> this.`30`
        40 -> this.`40`
        50 -> this.`50`
        60 -> this.`60`
        70 -> this.`70`
        80 -> this.`80`
        90 -> this.`90`
        95 -> this.`95`
        100 -> this.`100`
        else -> this.`90`
    }
    return Color(colorLong)
}



    val Material3ColorPalette.Companion.Primary :Material3ColorPalette by lazy {
        Material3ColorPalette(
            `0`  =0x000000,
            `10` =0x21005D,
            `20` =0x381E72,
            `30` =0x4F378B,
            `40` =0x6750A4,
            `50` =0x7F67BE,
            `60` =0x9A82DB,
            `70` =0xB69DF8,
            `80` =0xD0BCFF,
            `90` =0xEADDFF,
            `95` =0xF6EDFF,
            `100`=0xFFFBFE
        )
    }

    val Material3ColorPalette.Companion.Secondary :Material3ColorPalette by lazy {
        Material3ColorPalette(
            `0`  =0xFFFFFF,
            `10` =0x000000,
            `20` =0x1D192B,
            `30` =0x332D41,
            `40` =0x4A4458,
            `50` =0x625B71,
            `60` =0x7A7289,
            `70` =0x958DA5,
            `80` =0xB0A7C0,
            `90` =0xCCC2DC,
            `95` =0xE8DEF8,
            `100`=0xF6EDFF
        )
    }

    val Material3ColorPalette.Companion.Tertiary :Material3ColorPalette by lazy {
        Material3ColorPalette(
            `0`  =0xFFFFFF,
            `10` =0x000000,
            `20` =0x31111D,
            `30` =0x492532,
            `40` =0x633B48,
            `50` =0x7D5260,
            `60` =0x986977,
            `70` =0xB58392,
            `80` =0xD29DAC,
            `90` =0xEFB8C8,
            `95` =0xFFD8E4,
            `100`=0xFFECF1
        )
    }

    val Material3ColorPalette.Companion.Neutral :Material3ColorPalette by lazy {
        Material3ColorPalette(
            `0`  =0xFFFFFF,
            `10` =0x000000,
            `20` =0x1C1B1F,
            `30` =0x313033,
            `40` =0x484649,
            `50` =0x605D62,
            `60` =0x787579,
            `70` =0x939094,
            `80` =0xAEAAAE,
            `90` =0xC9C5CA,
            `95` =0xE6E1E5,
            `100`=0xF4EFF4
        )
    }


    val Material3ColorPalette.Companion.NeutralVariant :Material3ColorPalette by lazy {
        Material3ColorPalette(
            `0`  =0xFFFFFF,
            `10` =0x000000,
            `20` =0x1D1A22,
            `30` =0x322F37,
            `40` =0x49454F,
            `50` =0x605D66,
            `60` =0x79747E,
            `70` =0x938F99,
            `80` =0xAEA9B4,
            `90` =0xCAC4D0,
            `95` =0xE7E0EC,
            `100`=0xF5EEFA
        )
    }

    val Material3ColorPalette.Companion.Error :Material3ColorPalette by lazy {
        Material3ColorPalette(
            `0`  =0xFFFFFF,
            `10` =0x000000,
            `20` =0x410E0B,
            `30` =0x601410,
            `40` =0x8C1D18,
            `50` =0xB3261E,
            `60` =0xDC362E,
            `70` =0xE46962,
            `80` =0xEC928E,
            `90` =0xF2B8B5,
            `95` =0xF9DEDC,
            `100`=0xFCEEEE
        )
    }


    val Material3ColorPalette.Companion.LightTheme: ComposeColorPaletteScheme<Long> by lazy {
        object:ComposeColorPaletteScheme<Long>{
            override var primary =                       0xFF6750A4
            override var onPrimary =                     0xFFFFFFFF
            override var primaryContainer =              0xFFEADDFF
            override var onPrimaryContainer =            0xFF21005D
            override var secondary =                     0xFF625B71
            override var onSecondary =                   0xFFFFFFFF
            override var secondaryContainer =            0xFFE8DEF8
            override var onSecondaryContainer =          0xFF1D192B
            override var tertiary =                      0xFF7D5260
            override var onTertiary =                    0xFFFFFFFF
            override var tertiaryContainer =             0xFFFFD8E4
            override var onTertiaryContainer =           0xFF31111D
            override var error =                         0xFFB3261E
            override var onError =                       0xFFFFFFFF
            override var errorContainer =                0xFFF9DEDC
            override var onErrorContainer =              0xFF410E0B
            override var outline =                       0xFF79747E
            override var background =                    0xFFFFFBFE
            override var onBackground =                  0xFF1C1B1F
            override var surface =                       0xFFFFFBFE
            override var onSurface =                     0xFF1C1B1F
            override var surfaceVariant =                0xFFE7E0EC
            override var onSurfaceVariant =              0xFF49454F
            override var inverseSurface =                0xFF313033
            override var inverseOnSurface =              0xFFF4EFF4
            override var inversePrimary =                0xFFD0BCFF
            override var shadow =                        0xFF000000
            override var surfaceTint =                   0xFF6750A4
            override var outlineVariant =                0xFFCAC4D0
            override var scrim =                         0xFF000000

            override var textColorPrimary                    = primary
            override var textColorPrimaryInverse             = primaryContainer
            override var textColorSecondary                  = secondary
            override var textColorSecondaryInverse           = secondaryContainer
            override var textColorTertiary                   = tertiary
            override var textColorTertiaryInverse            = tertiaryContainer
            override var textColorPrimaryDisableOnly         = inverseOnSurface
            override var textColorPrimaryInverseDisableOnly  = inverseSurface
            override var textColorHint                       = surfaceTint
            override var textColorHintInverse                = scrim
            override var textColorHighlight                  = onPrimaryContainer
            override var textColorHighlightInverse           = onPrimary
            override var textColorLink                       = onSecondaryContainer
            override var textColorLinkInverse                = onSecondary
            override var textColorAlertDialogListItem        = primary

        }
    }

    val Material3ColorPalette.Companion.DarkTheme: ComposeColorPaletteScheme<Long> by lazy {
        object:ComposeColorPaletteScheme<Long>{
            override var primary =                     0xFFD0BCFF
            override var onPrimary =                   0xFF381E72
            override var primaryContainer =            0xFF4F378B
            override var onPrimaryContainer =          0xFFEADDFF
            override var secondary =                   0xFFCCC2DC
            override var onSecondary =                 0xFF332D41
            override var secondaryContainer =          0xFF4A4458
            override var onSecondaryContainer =        0xFFE8DEF8
            override var tertiary =                    0xFFEFB8C8
            override var onTertiary =                  0xFF492532
            override var tertiaryContainer =           0xFF633B48
            override var onTertiaryContainer =         0xFFFFD8E4
            override var error =                       0xFFF2B8B5
            override var onError =                     0xFF601410
            override var errorContainer =              0xFF8C1D18
            override var onErrorContainer =            0xFFF9DEDC
            override var outline =                     0xFF938F99
            override var background =                  0xFF1C1B1F
            override var onBackground =                0xFFE6E1E5
            override var surface =                     0xFF1C1B1F
            override var onSurface =                   0xFFE6E1E5
            override var surfaceVariant =              0xFF49454F
            override var onSurfaceVariant =            0xFFCAC4D0
            override var inverseSurface =              0xFFE6E1E5
            override var inverseOnSurface =            0xFF313033
            override var inversePrimary =              0xFF6750A4
            override var shadow =                      0xFF000000
            override var surfaceTint =                 0xFFD0BCFF
            override var outlineVariant =              0xFF49454F
            override var scrim =                       0xFF000000

            override var textColorPrimary                    = primary
            override var textColorPrimaryInverse             = primaryContainer
            override var textColorSecondary                  = secondary
            override var textColorSecondaryInverse           = secondaryContainer
            override var textColorTertiary                   = tertiary
            override var textColorTertiaryInverse            = tertiaryContainer
            override var textColorPrimaryDisableOnly         = inverseOnSurface
            override var textColorPrimaryInverseDisableOnly  = inverseSurface
            override var textColorHint                       = surfaceTint
            override var textColorHintInverse                = scrim
            override var textColorHighlight                  = onPrimaryContainer
            override var textColorHighlightInverse           = onPrimary
            override var textColorLink                       = onSecondaryContainer
            override var textColorLinkInverse                = onSecondary
            override var textColorAlertDialogListItem        = primary

        }
    }

